﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>出货管理-新建出货单</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<%@ include file="../common/config.jsp"%>
<%@ include file="../common/validate.jsp"%>
<%@ include file="../common/autocomplete.jsp"%>
<script type="text/javascript" src="js/calendar/WdatePicker.js" ></script>
<script type="text/javascript">

function deleteProduct(button) {
	$(button).parent().parent().remove();
}

$(document).ready(function() {
	$("#addOrder").validate();
});
</script>
</HEAD>
<BODY>
     <s:form action="addOrder" name="order">
     <s:hidden name="order.purchaseOrderId" value="%{order.id}" />
    <div class="subnav" align="left">
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="images/title-pk.gif" border="0"  align="middle"/>&nbsp;<span class="subnavtxt1">出货管理</span>
			&nbsp;<img src="images/leftico2.gif" border="0"  align="middle"/>&nbsp;<span class="subnavtxt2">新建出货单</span></td>
		  </tr>
		</table>
      </div>
     <div class="main_1">
       <table width="99%" border="0" cellpadding="5" cellspacing="1" bgcolor="#D3DEEF">
         <tr>
           <td align="left" class="Blue14" bgcolor="#FAFAFA" colspan="2">订单信息</td>
         </tr>
         <tr>
		    <td width="19%" bgcolor="#FAFAFA" align="right"><strong>创建日期</strong></td>
		    <td width="81%" bgcolor="#FAFAFA"><input type="text" name="order.createDate" readonly="readonly" size="10" value='<%=com.javaeye.chenweihuacwh.util.DateUtils.dateToString("yyyy-MM-dd")%>' /></td>
		 </tr>
		<tr>
	      <td bgcolor="#FAFAFA" align="right"><strong>客户名称</strong></td>
	      <td bgcolor="#FAFAFA">
			<s:property value="order.customName" />
			<s:hidden name="order.customId" />
			<s:hidden name="order.customName" />
		  </td>
		</tr>
		<tr>
	      <td bgcolor="#FAFAFA" align="right"><strong>订单号</strong></td>
	      <td bgcolor="#FAFAFA">
	        <s:property value="order.contractNo" />
		    <s:hidden name="order.contractNo" />
	      </td>
		</tr>
         <tr>
		    <td bgcolor="#FAFAFA" align="right"><strong>预出货日期</strong></td>
		    <td bgcolor="#FAFAFA">
		      <s:date name="order.expectOutDate" format="yyyy-MM-dd"/>
		      <s:hidden name="order.expectOutDate" />
			</td>
		 </tr>
       </table>
     </div>
     <div class="clear"></div>
	 <div class="main_1">
       <table width="99%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a" id="productList">
        <tr class="ksglxx2bg">
          <th width="10%" >分类</th>
          <th width="10%" >品名</th>
          <th width="20%" >规格</th>
          <th width="10%" >代码</th>
          <th width="10%" >客户代码</th>
		  <th width="8%" align="left">订单数量</th>
		  <th width="8%" align="left">单位</th>
		  <th width="8%" align="left">已安排数量</th>
		  <th width="8%" align="left">安排数量</th>
		  <th align="left">&nbsp;</th>
		</tr>
		<s:iterator value="order.orderDetails" id="detail" status="st">
        <tr class="odd">
          <td>
               <s:property value="#detail.productCategory" />
               <s:hidden name="productCategorys" value="%{#detail.productCategory}" />
          </td>
          <td>
               <s:property value="#detail.productName" />
		       <s:hidden name="productNames" value="%{#detail.productName}" />
		       <s:hidden name="productIds" value="%{#detail.productId}" />
          </td>
          <td>
               <s:property value="#detail.productType" />
               <s:hidden name="productTypes" value="%{#detail.productType}" />
          </td>
          <td>
               <s:property value="#detail.productNo" />
               <s:hidden name="productNos" value="%{#detail.productNo}" />
          </td>
          <td>
               <s:property value="#detail.customNo" />
               <s:hidden name="customNos" value="%{#detail.customNo}" />
          </td>
          <td>
               <s:property value="#detail.number" />
			   <s:hidden name="productPrices" value="%{#detail.price}" />
          </td>
          <td>
               <s:property value="#detail.unit" />
               <s:hidden name="productUnits" value="%{#detail.unit}" />
          </td>
          <td>
               <s:property value="#detail.planNumber" />
          </td>
          <td>
               <s:textfield id="productNums-%{#st.index}" name="productNums" size="10" value="%{#detail.number - #detail.planNumber}" 
               		cssClass="{required:true,maxlength:10,number:true,max:%{#detail.number - #detail.planNumber}}"/>
          </td>
          <td>
               <input type="button" value="删除" class="input1" onclick='deleteProduct(this)' />
          </td>
	    </tr>
	    </s:iterator>
       </table>
      </div>
     <div class="clear"></div>
	 <div class="main_1">
		<table width="98%" border="0" cellpadding="5" cellspacing="0" class="gr-text1">
		   <tr>
			 <td width="45%" align="right">
			   <s:submit value="创建" cssClass="input1" />&nbsp;&nbsp;
			   <input type="button" value="关闭" class="input1" onclick='javascript:window.location.href="purchaseOrderList.action"' /></td>
			 <td width="55%" align="left"></td>
		   </tr>
	   </table>
	</div>
	<div class="clear"></div>
	</s:form>
</BODY></HTML>
